package com.cowin.config;



import com.cowin.webservice.monitor.MonitorWebService;
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;
import javax.xml.ws.Endpoint;


/**
 * Copyright (C), 1998-2018, 奇瑞信息
 *
 * @author : 于超
 * @Date: 2019/8/30 13:31
 * @Description:
 */

@Configuration
public class CxfConfig {
    private static final Logger logger = LoggerFactory.getLogger(CxfConfig.class);
    @Resource
    private Bus bus;



    @Resource
    private MonitorWebService lineMonitorWebService;


    @Bean
    public Endpoint lineMonitorEndpoint() {
        EndpointImpl endpoint = new EndpointImpl(bus, lineMonitorWebService);
        endpoint.publish("/mes/monitorWebService");
        logger.info("发布 monitorWebService");
        return endpoint;
    }
}
